#ifndef _EB0_IMAGE_MANAGER_H_
#define _EB0_IMAGE_MANAGER_H_

#include <EB0/Prereq.h>
#include <SFML/Graphics.hpp>
#include <map>

namespace EB0
{
namespace Managers
{
	class ImageManager
	{
	public:
		~ImageManager();

		sf::Image* createImage(char* filename);
		bool destroyImage(sf::Image*& image);
		bool destroyImage(char* filename);
		void destroyAllImages();

		static ImageManager& getSingleton();
		static ImageManager* getSingletonPtr();

	private:
		typedef std::map<std::string, sf::Image*> ImageMap;

		ImageManager();
		ImageManager(const ImageManager&) {}
		ImageManager &operator=(const ImageManager&);

		ImageMap mImages;

		mutable sf::Mutex mMutex;
		static ImageManager* mSingleton;
	};
} // namespace Managers
}

#endif // _EB0_IMAGE_MANAGER_H_